<script>
import detailCommon from "@/api/ppm/detailCommon.js";
import ppmForm from "@/crm3.0part7-ppm/core/ppmForm.vue";
import conmondt from "@/mixins/order/conmondt.js";
export default {
  name: "mstp10461097",
  mixins: [ppmForm, conmondt],

  created() {
    //明细回显回调函数注册，名称必须固定 add wuyx
    window.initPageOfferDetails = this.initPageOfferDetails;
  },
  mounted() {},

  methods: {
    /**
     * 明细回显回调
     */
    initPageOfferDetails(data) {
      console.log("MSTP_312_订单送审前");
      console.log("data", data);
      console.log("formData", this.formData);
      this.init(); //初始化方法
      this.contractNumType(this.formData["10461652-142002138"].value); //合同编号类型
      this.isRoad(this.formData["10461653-100000011"].value); //是否管理电路
      this.IDC(); //是否IDC机房专线
      this.whdj(this.formData["10461653-100011554"].value); //电路维护等级
      this.businessType(); //业务类型
      this.latService(); //是否为低延时业务
      this.monthCycle(); //收费周期
      this.portTypeA(); //端口类型
      this.portTypeB(); //端口类型
      this.equiSourceA(this.formData["10461656-100012474"].value); //甲端设备来源
      this.equiSourceB(this.formData["10461657-100012474"].value); //乙端设备来源
      this.feeShow(data); //费用是否可改
      this.oneFree(this.formData["10461658-141000009"].value);//一次性费是否免费

    },

    init() {
      //可支持MTU数值（甲端） 非空展示
      if (this.formData["10461656-141000170"].value != "") {
        this.formData["10461656-141000170"].isshow = true;
      } else {
        this.formData["10461656-141000170"].isshow = false;
      }
      //可支持MTU数值（乙端） 非空展示
      if (this.formData["10461657-141000170"].value != "") {
        this.formData["10461657-141000170"].isshow = true;
      } else {
        this.formData["10461657-141000170"].isshow = false;
      }

      //MTU数值情况（甲端） 非空展示
      if (this.formData["10461656-141000168"].value != "") {
        this.formData["10461656-141000168"].isshow = true;
      } else {
        this.formData["10461656-141000168"].isshow = false;
      }
      //MTU数值情况（乙端） 非空展示
      if (this.formData["10461657-141000168"].value != "") {
        this.formData["10461657-141000168"].isshow = true;
      } else {
        this.formData["10461657-141000168"].isshow = false;
      }

      //国际公司展示
      let orgId = JSON.parse(sessionStorage.getItem("changeRow")).createOrgId;
      if (
        orgId == "1944890" ||
        orgId == "1944891" ||
        orgId == "1944889" ||
        orgId == "1950850" ||
        orgId == "1978013"
      ) {
        this.formData["10461653-142001982"].isshow = true; //是否智能IEPL中继通道 展示
        this.formData["10461656-142002103"].isshow = true; //Licas网管配置方式 展示
        this.formData["10461657-142002103"].isshow = true; //Licas网管配置方式 展示
      } else {
        this.formData["10461653-142001982"].isshow = false; //是否智能IEPL中继通道 隐藏
        this.formData["10461656-142002103"].isshow = false; //Licas网管配置方式 隐藏
        this.formData["10461657-142002103"].isshow = false; //Licas网管配置方式 隐藏
      }
      //集团发起
      if (orgId == "1944640") {
        this.formData["10461653-100014235"].isshow = true; //是否提供路由图 展示
        this.formData["10461653-100012631"].isshow = false; //是否idc机房专线字段 隐藏
        this.SetRequired({
          attrName: "是否IDC机房专线",
          formkey: "10461653-100012631",
          reqName: "empty",
          reqStatus: false,
        }); //是否IDC机房专线 非必填
      } else {
        this.formData["10461653-100014235"].isshow = false; //是否提供路由图 隐藏
      }

      //电路标签
      if (this.formData["10461658-142002190"].value == "13241001") {
        // this.formData["10461658-142002190"].isshow = false; //电路标签
        this.formData["10461658-142002191"].isshow = false; //电路标签文号
      }
    },

    //合同编号类型
    contractNumType(val) {
      //合同是否为测试合同不为是
      if (val != "142002138004") {
        this.formData["10461653-142002124"].isshow = false; //是否为测试电路 隐藏
      }
    },

    //是否管理电路
    isRoad(val) {
      if (val == "1") {
        //是
        this.formData["10461653-100012022"].isshow = true; //管理电路接入的城市 展示
        this.SetRequired({
          attrName: "网管专家BIZID",
          formkey: "10461653-141000043",
          reqName: "empty",
          reqStatus: true,
        }); //网管专家BIZID 必填
      } else {
        this.formData["10461653-100012022"].isshow = false; //管理电路接入的城市 隐藏
        this.SetRequired({
          attrName: "网管专家BIZID",
          formkey: "10461653-141000043",
          reqName: "empty",
          reqStatus: false,
        }); //网管专家BIZID 非必填
      }
    },

    //是否IDC机房专线
    IDC() {
      if (this.formData["10461653-100012631"].value == "1") {
        this.formData["10461653-142002498"].isshow = true; //机房专线类型 展示
        this.SetRequired({
          attrName: "机房专线类型",
          formkey: "10461653-142002498",
          reqName: "empty",
          reqStatus: true,
        }); //机房专线类型 必填
      } else {
        this.formData["10461653-142002498"].isshow = false; //机房专线类型 隐藏
        this.SetRequired({
          attrName: "机房专线类型",
          formkey: "10461653-142002498",
          reqName: "empty",
          reqStatus: false,
        }); //机房专线类型 非必填
        this.formData["10461653-142002498"].value = ""; //机房专线类型 清空
      }
      this.comLine();
    },

    //机房专线类型
    comLine() {
      this.formData["10461653-142002499"].isshow = false; //甲端机房编码、
      this.formData["10461653-100011034"].isshow = false; //乙端机房编码
      if (this.formData["10461653-142002498"].value == "2468001") {
        this.formData["10461653-142002499"].isshow = true; //甲端机房编码
      } else if (this.formData["10461653-142002498"].value == "2468002") {
        this.formData["10461653-100011034"].isshow = true; //乙端机房编码
      } else if (this.formData["10461653-142002498"].value == "2468003") {
        this.formData["10461653-142002499"].isshow = true; //甲端机房编码
        this.formData["10461653-100011034"].isshow = true; //乙端机房编码
      }
    },

    //MTU数值
    mtuNumber(val) {
      let check = /^[1-9]\d*$/;
      if (check.test(val)) {
        if (val > 9600 || val < 1518) {
          this.$alert("只能填写1518~9600之间的正整数!", "提示", {
            type: "warning",
            confirmButtonText: "关闭",
          });
          this.formData["10461653-141000144"].value = "";
        }
      } else {
        this.$alert("只能填写1518~9600之间的正整数!", "提示", {
          type: "warning",
          confirmButtonText: "关闭",
        });
        this.formData["10461653-141000144"].value = "";
      }
    },

    //电路维护等级
    whdj(val) {
      this.formData["10461653-100000523"].isshow = false; //双电路承载方式 隐藏
      this.SetRequired({
        attrName: "双电路承载方式",
        formkey: "10461653-100000523",
        reqName: "empty",
        reqStatus: false,
      }); //双电路承载方式 非必填
      if (val == "80050036001" || val == "80050036002") {
        this.formData["10461653-100000523"].isshow = true; //双电路承载方式 展示
        this.SetRequired({
          attrName: "双电路承载方式",
          formkey: "10461653-100000523",
          reqName: "empty",
          reqStatus: true,
        }); //双电路承载方式 必填
      }
    },

    //业务类型   houbin  add
    businessType() {
      if (this.formData["10461653-100001004"].value == "88800130002") {
        //点到多点
        this.formData["10461656-100014043"].isshow = true; //甲端是否汇聚主点 展示
        this.formData["10461657-100014043"].isshow = true; //乙端是否汇聚主点 展示
        this.SetRequired({
          attrName: "是否为汇聚主点",
          formkey: "10461656-100014043",
          reqName: "empty",
          reqStatus: true,
        }); //甲端是否汇聚主点 必填
        this.SetRequired({
          attrName: "是否为汇聚主点",
          formkey: "10461657-100014043",
          reqName: "empty",
          reqStatus: true,
        }); //乙端是否汇聚主点 必填
        this.formData["10461656-141000146"].isshow = true; //甲端VLAN透传 展示
        this.formData["10461657-141000146"].isshow = true; //乙端VLAN透传 展示
        this.formData["10461656-141000152"].isshow = true; //甲端QINQ 展示
        this.formData["10461657-141000152"].isshow = true; //甲端QINQ 展示
        //CE-VLAN ID 点到多点不显示
        this.formData["10461656-141000150"].isshow = false;
        this.formData["10461657-141000150"].isshow = false;
        this.formData["10461656-141000150"].value = "";
        this.formData["10461657-141000150"].value = "";
      } else {
        //点到点
        this.formData["10461656-100014043"].isshow = false; //甲端是否汇聚主点 隐藏
        this.formData["10461657-100014043"].isshow = false; //乙端是否汇聚主点 隐藏
        this.SetRequired({
          attrName: "是否为汇聚主点",
          formkey: "10461656-100014043",
          reqName: "empty",
          reqStatus: false,
        }); //甲端是否汇聚主点 非必填
        this.SetRequired({
          attrName: "是否为汇聚主点",
          formkey: "10461657-100014043",
          reqName: "empty",
          reqStatus: false,
        }); //乙端是否汇聚主点 非必填
        this.formData["10461656-141000146"].isshow = false; //甲端VLAN透传 隐藏
        this.formData["10461657-141000146"].isshow = false; //乙端VLAN透传 隐藏
        this.formData["10461656-141000146"].value = ""; //甲端VLAN透传 清空
        this.formData["10461657-141000146"].value = ""; //乙端VLAN透传 清空
        this.formData["10461656-141000152"].isshow = false; //甲端QINQ 隐藏
        this.formData["10461657-141000152"].isshow = false; //甲端QINQ 隐藏
        this.formData["10461656-141000152"].value = ""; //甲端QINQ 清空
        this.formData["10461657-141000152"].value = ""; //乙端QINQ 清空
        //CE-VLAN ID 点到点显示
        this.formData["10461656-141000150"].isshow = true;
        this.formData["10461657-141000150"].isshow = true;
      }
      this.hjzdAFun(); //甲端是否为汇聚主点
      this.hjzdBFun(); //乙端是否为汇聚主点
      this.QINA(this.formData["10461656-141000152"].value); //甲端QINQ
      this.QINB(this.formData["10461657-141000152"].value); //乙端QINQ
    },

    //甲端是否为汇聚主点
    hjzdAFun() {
      if (
        this.formData["10461656-100014043"].value == "1" &&
        this.formData["10461653-100001004"].value == "88800130002"
      ) {
        this.formData["10461656-100013935"].isshow = true; //甲端参考电路接入号类型 展示
        this.SetRequired({
          attrName: "参考电路接入号类型",
          formkey: "10461656-100013935",
          reqName: "empty",
          reqStatus: true,
        }); //甲端参考电路接入号类型 必填
        this.formData["10461656-141000148"].isshow = true; //甲端S-VLAN ID 展示
        this.SetRequired({
          attrName: "S-VLAN ID",
          formkey: "10461656-141000148",
          reqName: "empty",
          reqStatus: true,
        }); //甲端S-VLAN ID 必填
        this.formData["10461656-142002908"].isshow = true; //甲端汇聚组号 展示
        this.SetRequired({
          attrName: "汇聚组号",
          formkey: "10461656-142002908",
          reqName: "empty",
          reqStatus: true,
        }); //甲端汇聚组号 必填
      } else {
        this.formData["10461656-100013935"].isshow = false; //甲端参考电路接入号类型 隐藏
        this.SetRequired({
          attrName: "参考电路接入号类型",
          formkey: "10461656-100013935",
          reqName: "empty",
          reqStatus: false,
        }); //甲端参考电路接入号类型 非必填
        this.formData["10461656-100013935"].value = ""; //甲端参考电路接入号类型  清空
        this.formData["10461656-141000148"].isshow = false; //甲端S-VLAN ID 隐藏
        this.SetRequired({
          attrName: "S-VLAN ID",
          formkey: "10461656-141000148",
          reqName: "empty",
          reqStatus: false,
        }); //甲端S-VLAN ID 非必填
        this.formData["10461656-141000148"].value = ""; //甲端参考电路接入号类型  清空
        this.formData["10461656-142002908"].isshow = false; //甲端汇聚组号 隐藏
        this.SetRequired({
          attrName: "汇聚组号",
          formkey: "10461656-142002908",
          reqName: "empty",
          reqStatus: false,
        }); //甲端汇聚组号 非必填
        this.formData["10461656-142002908"].value = ""; //甲端汇聚组号  清空
        if (this.formData["10461657-100014043"].value == "2") {
          //当乙端汇聚主点为否时
          //甲乙两端可以同时选是不能同时选否
          //点到多点
          if (
            this.formData["10461656-100014043"].value == "2" &&
            this.formData["10461653-100001004"].value == "88800130002"
          ) {
            //                        this.$message({ message: "甲端乙端是否汇聚不可以同时选否", showClose: true, });
            this.$alert("甲端乙端是否汇聚不可以同时选否", "提示", {
              type: "warning",
              confirmButtonText: "关闭",
            });
            this.formData["10461656-100014043"].value = "";
          }
        }
      }
      this.jrhTypeA(); //甲端参考电路接入号类型
    },

    //乙端是否为汇聚主点
    hjzdBFun() {
      if (
        this.formData["10461657-100014043"].value == "1" &&
        this.formData["10461653-100001004"].value == "88800130002"
      ) {
        this.formData["10461657-100013935"].isshow = true; //乙端参考电路接入号类型 展示
        this.SetRequired({
          attrName: "参考电路接入号类型",
          formkey: "10461657-100013935",
          reqName: "empty",
          reqStatus: true,
        }); //乙端参考电路接入号类型 必填
        this.formData["10461657-141000148"].isshow = true; //乙端S-VLAN ID 展示
        this.SetRequired({
          attrName: "S-VLAN ID",
          formkey: "10461657-141000148",
          reqName: "empty",
          reqStatus: true,
        }); //乙端S-VLAN ID 必填
        this.formData["10461657-142002908"].isshow = true; //乙端汇聚组号 展示
        this.SetRequired({
          attrName: "汇聚组号",
          formkey: "10461657-142002908",
          reqName: "empty",
          reqStatus: true,
        }); //乙端汇聚组号 必填
      } else {
        this.formData["10461657-100013935"].isshow = false; //乙端参考电路接入号类型 隐藏
        this.SetRequired({
          attrName: "参考电路接入号类型",
          formkey: "10461657-100013935",
          reqName: "empty",
          reqStatus: false,
        }); //乙端参考电路接入号类型 非必填
        this.formData["10461657-100013935"].value = ""; //乙端参考电路接入号类型  清空
        this.formData["10461657-141000148"].isshow = false; //乙端S-VLAN ID 隐藏
        this.SetRequired({
          attrName: "S-VLAN ID",
          formkey: "10461657-141000148",
          reqName: "empty",
          reqStatus: false,
        }); //乙端S-VLAN ID 非必填
        this.formData["10461657-141000148"].value = ""; //乙端S-VLAN ID  清空
        this.formData["10461657-142002908"].isshow = false; //乙端汇聚组号 隐藏
        this.SetRequired({
          attrName: "汇聚组号",
          formkey: "10461657-142002908",
          reqName: "empty",
          reqStatus: false,
        }); //乙端汇聚组号 非必填
        this.formData["10461657-142002908"].value = ""; //乙端汇聚组号  清空
        if (this.formData["10461656-100014043"].value == "2") {
          //当乙端汇聚主点为否时
          //甲乙两端可以同时选是不能同时选否
          if (
            this.formData["10461657-100014043"].value == "2" &&
            this.formData["10461653-100001004"].value == "88800130002"
          ) {
            // this.$message({ message: "甲端乙端是否汇聚不可以同时选否", showClose: true, });
            this.$alert("甲端乙端是否汇聚不可以同时选否", "提示", {
              type: "warning",
              confirmButtonText: "关闭",
            });
            this.formData["10461657-100014043"].value = "";
          }
        }
      }
      this.jrhType(); //乙端参考电路接入号类型
    },

    //甲端接入号类型
    jrhTypeA() {
      if (this.formData["10461656-100013935"].value == "88800140002") {
        this.SetRequired({
          attrName: "参考电路接入号",
          formkey: "10461656-100013936",
          reqName: "empty",
          reqStatus: true,
        }); //参考电路接入号 必填
      } else {
        this.SetRequired({
          attrName: "参考电路接入号",
          formkey: "10461656-100013936",
          reqName: "empty",
          reqStatus: false,
        }); //参考电路接入号 非必填
      }
    },

    //乙端接入号类型
    jrhType() {
      if (this.formData["10461657-100013935"].value == "88800140002") {
        this.SetRequired({
          attrName: "参考电路接入号",
          formkey: "10461657-100013936",
          reqName: "empty",
          reqStatus: true,
        }); //参考电路接入号 必填
      } else {
        this.SetRequired({
          attrName: "参考电路接入号",
          formkey: "10461657-100013936",
          reqName: "empty",
          reqStatus: false,
        }); //参考电路接入号 非必填
      }
    },

    //甲端QING
    QINA(val) {
      if (val == "1") {
        this.SetRequired({
          attrName: "甲端VLAN透传",
          formkey: "10461656-141000146",
          reqName: "empty",
          reqStatus: true,
        });
      } else {
        this.SetRequired({
          attrName: "甲端VLAN透传",
          formkey: "10461656-141000146",
          reqName: "empty",
          reqStatus: false,
        });
      }
      this.Mturequired();
    },

    //乙端QING
    QINB(val) {
      if (val == "1") {
        this.SetRequired({
          attrName: "乙端VLAN透传",
          formkey: "10461657-141000146",
          reqName: "empty",
          reqStatus: true,
        });
      } else {
        this.SetRequired({
          attrName: "乙端VLAN透传",
          formkey: "10461657-141000146",
          reqName: "empty",
          reqStatus: false,
        });
      }
      this.Mturequired();
    },

    Mturequired() {
      if (
        this.formData["10461656-141000152"].value == "1" ||
        this.formData["10461657-141000152"].value == "1"
      ) {
        this.SetRequired({
          attrName: "MTU数值",
          formkey: "10461653-141000144",
          reqName: "empty",
          reqStatus: true,
        });
      } else {
        this.SetRequired({
          attrName: "MTU数值",
          formkey: "10461653-141000144",
          reqName: "empty",
          reqStatus: false,
        });
      }
    },

    //S-VLAN ID显示是的校验
    SVID() {
      let check = /^[1-9]\d*$/;
      if (check.test(this.formData["10461656-141000148"].value)) {
        if (this.formData["10461656-141000148"].value > 4096) {
          this.$alert("只能填写1~4096之间的正整数!", "提示", {
            type: "warning",
            confirmButtonText: "关闭",
          });
          this.formData["10461656-141000148"].value = "";
        }
      }
      if (check.test(this.formData["10461657-141000148"].value)) {
        if (this.formData["10461657-141000148"].value > 4096) {
          this.$alert("只能填写1~4096之间的正整数!", "提示", {
            type: "warning",
            confirmButtonText: "关闭",
          });
          this.formData["10461657-141000148"].value = "";
        }
      }
    },

    //是否为低延时业务
    latService() {
      this.formData["10461653-142001015"].isshow = false; //时延期望值(ms)
      this.formData["10461653-142000604"].isshow = false; //时延类型
      this.formData["10461653-142000602"].isshow = false; //POP-to-POP时延(SLA承诺)
      this.formData["10461653-142000603"].isshow = false; //END-to-END时延(SLA承诺)
      this.formData["10461653-142001016"].isshow = false; //时延预估值(ms)
      this.formData["10461653-142001017"].isshow = false; //时延承诺值(ms)
      this.formData["10461653-142001018"].isshow = false; //时延交付测试值(ms)
      this.formData["10461653-142001019"].isshow = false; //甲端城域内时延
      this.formData["10461653-142001020"].isshow = false; //乙端城域内时延
      this.formData["10461653-142001021"].isshow = false; //甲端省内时延
      this.formData["10461653-142001022"].isshow = false; //乙端省内时延
      this.formData["10461653-142001023"].isshow = false; //省际时延
      this.formData["10461653-142000605"].isshow = false; //主备路由保护倒换的恢复方式
      let orgId = JSON.parse(sessionStorage.getItem("changeRow")).createOrgId;
      if (
        //国际公司
        orgId == "1944890" ||
        orgId == "1944891" ||
        orgId == "1944889" ||
        orgId == "1950850" ||
        orgId == "1978013"
      ) {
        if (this.formData["10461653-142000601"].value == "1") {
          this.formData["10461653-142000604"].isshow = true; //时延类型
          this.SetRequired({
            attrName: "时延类型",
            formkey: "10461653-142000604",
            reqName: "empty",
            reqStatus: true,
          }); //时延类型 必填
          this.formData["10461653-142000602"].isshow = true; //POP-to-POP时延(SLA承诺)
          this.formData["10461653-142000603"].isshow = true; //END-to-END时延(SLA承诺)
          this.formData["10461653-142000605"].isshow = true; //主备路由保护倒换的恢复方式
        } else {
          this.formData["10461653-142000604"].isshow = false; //时延类型
          this.SetRequired({
            attrName: "时延类型",
            formkey: "10461653-142000604",
            reqName: "empty",
            reqStatus: false,
          }); //时延类型 非必填
          this.formData["10461653-142000604"].value = ""; //时延类型  清空
          this.formData["10461653-142000602"].isshow = false; //POP-to-POP时延(SLA承诺)
          this.formData["10461653-142000602"].value = ""; //POP-to-POP时延(SLA承诺)  清空
          this.formData["10461653-142000603"].isshow = false; //END-to-END时延(SLA承诺)
          this.formData["10461653-142000603"].value = ""; //END-to-END时延(SLA承诺)  清空
        }
      } else {
        //国内规则
        if (this.formData["10461653-142000601"].value == "1") {
          this.formData["10461653-142001015"].isshow = true; //时延期望值(ms)
          this.SetRequired({
            attrName: "时延期望值(ms)",
            formkey: "10461653-142001015",
            reqName: "empty",
            reqStatus: true,
          }); //时延期望值(ms) 必填
          this.formData["10461653-142001016"].isshow = true; //时延预估值(ms)
          this.formData["10461653-142001017"].isshow = true; //时延承诺值(ms)
          this.formData["10461653-142001018"].isshow = true; //时延交付测试值(ms)
          this.formData["10461653-142001019"].isshow = true; //甲端城域内时延
          this.formData["10461653-142001020"].isshow = true; //乙端城域内时延
          this.formData["10461653-142001021"].isshow = true; //甲端省内时延
          this.formData["10461653-142001022"].isshow = true; //乙端省内时延
          this.formData["10461653-142001023"].isshow = true; //省际时延
        } else {
          this.formData["10461653-142001015"].isshow = false; //时延期望值(ms)
          this.SetRequired({
            attrName: "时延期望值(ms)",
            formkey: "10461653-142001015",
            reqName: "empty",
            reqStatus: false,
          }); //时延期望值(ms) 非必填
          this.formData["10461653-142001015"].value = ""; //时延期望值(ms)  清空
        }
      }
    },

    //时延期望值
    timeDelay(val) {
      if (Number(val)) {
        if (val >= 1 && val <= 100) {
          var y = String(val).indexOf(".") + 1;
          if (y != 0) {
            var count = String(val).length - y; //获取小数点后的个数
            if (count > 1 || count == 0) {
              this.$alert("只能填写1~100之间的整数或者一位小数!", "提示", {
                type: "warning",
                confirmButtonText: "关闭",
              });
              this.formData["10461653-142001015"].value = "";
            }
          }
        } else {
          this.$alert("只能填写1~100之间的整数或者一位小数!", "提示", {
            type: "warning",
            confirmButtonText: "关闭",
          });
          this.formData["10461653-142001015"].value = "";
        }
      } else {
        this.$alert("只能填写1~100之间的整数或者一位小数!", "提示", {
          type: "warning",
          confirmButtonText: "关闭",
        });
        this.formData["10461653-142001015"].value = "";
      }
    },

    //POP-to-POP时延(SLA承诺)
    POPlength(val) {
      if (val.length > 20) {
        this.$alert("输入文本长度不能超过20位!", "提示", {
          type: "warning",
          confirmButtonText: "关闭",
        });
        this.formData["10461653-142000602"].value = "";
      }
    },

    //END-to-END时延(SLA承诺)
    ENDlength(val) {
      if (val.length > 20) {
        this.$alert("输入文本长度不能超过20位!", "提示", {
          type: "warning",
          confirmButtonText: "关闭",
        });
        this.formData["10461653-142000603"].value = "";
      }
    },

    //收费周期
    monthCycle() {
      if (this.formData["10461658-100010009"].value == "80050019028") {
        this.formData["10461658-142001024"].isshow = true; //预收月数
        this.SetRequired({
          attrName: "预收月数",
          formkey: "10461658-142001024",
          reqName: "empty",
          reqStatus: true,
        }); //预收月数 必填
      } else {
        this.formData["10461658-142001024"].isshow = false; //预收月数
        this.SetRequired({
          attrName: "预收月数",
          formkey: "10461658-142001024",
          reqName: "empty",
          reqStatus: false,
        }); //预收月数 非必填
      }
    },

    //费用限制
    numberCheck(val) {
      if (val == "0") {
        this.feeVal = val;
      } else {
        let oldValue = val;
        let newValue = val;
        newValue = newValue.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
        newValue = newValue.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的
        newValue = newValue.replace(/^\./g, ""); //必须保证第一个为数字而不是.
        newValue = newValue
          .replace(".", "$#$")
          .replace(/\./g, "")
          .replace("$#$", ".");
        newValue = newValue.replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3"); //只能输入两个小数
        if (newValue) {
          let arr = newValue.split(".");
          newValue =
            Number(arr[0]) + (arr[1] === undefined ? "" : "." + arr[1]);
        }
        if (newValue.indexOf(".") < 0 && newValue != "") {
          //以上已经过滤，此处控制的是如果没有小数点，首位不能为类似于 01、02的金额
          newValue = parseFloat(newValue);
        }
        if (oldValue != newValue) {
          this.$alert("请输入正整数或者小数点后两位小数!", "提示", {
            type: "warning",
            confirmButtonText: "关闭",
          });
        }
        this.feeVal = newValue;
      }
    },

    //甲端调测费
    CommRentA(val) {
      this.numberCheck(val);
      this.formData["10461659-100012523"].value = this.feeVal;
      this.feeVal = "";
    },

    //乙端调测费
    CommRentB(val) {
      this.numberCheck(val);
      this.formData["10461660-100012523"].value = this.feeVal;
      this.feeVal = "";
    },

    //甲端月租费
    monthlyRentA(val) {
      this.numberCheck(val);
      this.formData["10461659-100010742"].value = this.feeVal;
      this.feeVal = "";
    },

    //乙端月租费
    monthlyRentB(val) {
      this.numberCheck(val);
      this.formData["10461660-100010742"].value = this.feeVal;
      this.feeVal = "";
    },

    //国内长途月租费
    domDistanceRent(val) {
      this.numberCheck(val);
      this.formData["10461661-100012567"].value = this.feeVal;
      this.feeVal = "";
    },

    //国际长途月租费
    intDistanceRent(val) {
      this.numberCheck(val);
      this.formData["10461662-100012533"].value = this.feeVal;
      this.feeVal = "";
    },

    //国际应付对端金额
    intOppDistanceRent(val) {
      this.numberCheck(val);
      this.formData["10461662-100012713"].value = this.feeVal;
      this.feeVal = "";
    },

    //对端结算金额
    intSetDistanceRent(val) {
      this.numberCheck(val);
      this.formData["10461662-100013341"].value = this.feeVal;
      this.feeVal = "";
    },

    //一次费是否免费   houbin add
    oneFree(val) {
      //免费 公免
      if (val == "11"||val == "10") {
        //调测费默认为0
        this.formData["10461659-100012523"].value = "0";
        this.formData["10461660-100012523"].value = "0";
        this.formData["10461659-100012523"].disabled=true;
        this.formData["10461660-100012523"].disabled=true;
        this.formData["10461658-100012076"].value='1';//一次性费默认为是不可改
        this.formData["10461658-100012076"].disabled=true;
        this.SetRequired({  attrName: "甲端一次性费币种", formkey: "10461659-100010651", reqName: "empty", reqStatus: true, });  //甲端一次性费币种 必填
        this.SetRequired({  attrName: "甲端一次性费币种", formkey: "10461660-100010651", reqName: "empty", reqStatus: true, });  //乙端一次性费币种 必填
      }else{
        this.formData["10461659-100012523"].disabled=false;
        this.formData["10461660-100012523"].disabled=false;
        this.formData["10461658-100012076"].disabled=false;
        this.SetRequired({  attrName: "甲端一次性费币种", formkey: "10461659-100010651", reqName: "empty", reqStatus: false, });   
        this.SetRequired({  attrName: "甲端一次性费币种", formkey: "10461660-100010651", reqName: "empty", reqStatus: false, });   

      }
    },

    /**
     * 设备产商弹窗选中回调方法，回显设备型号、主控板软件版本
     */
    getInputGridValue(obj, flag) {
      let key = obj["key"];
      let optionItem = this.formData[key];
      let itemDevType = detailCommon.getItemByAttrIdRolcd(
        "100013577",
        optionItem.attrRoleCd,
        this.formData
      );
      let itemSoftVersion = detailCommon.getItemByAttrIdRolcd(
        "100012654",
        optionItem.attrRoleCd,
        this.formData
      );
      detailCommon.setItemVal(itemDevType, obj.data.devType);
      detailCommon.setItemVal(itemSoftVersion, obj.data.softVersion);
      if (key.split("-")[1] == "100012972") {
        this.creatCustInfo(obj, flag);
      }
    },

    portTypeA() {
      let portType = this.formData["10461656-100013204"].value;
      if (portType == "80050062014" || portType == "80050062009") {
        this.formData["10461656-141000174"].isshow = true; //工作模式
      } else {
        this.formData["10461656-141000174"].isshow = false; //工作模式
        this.formData["10461656-141000174"].value = "";
      }
    },

    portTypeB() {
      let portType = this.formData["10461657-100013204"].value;
      if (portType == "80050062014" || portType == "80050062009") {
        this.formData["10461657-141000174"].isshow = true; //工作模式
      } else {
        this.formData["10461657-141000174"].isshow = false; //工作模式
        this.formData["10461657-141000174"].value = "";
      }
    },
    //甲端设备来源
    equiSourceA(val) {
      if (val == "30320001") {
        //设备产商 必填
        this.SetRequired({
          attrName: "设备产商",
          formkey: "10461656-100012466",
          reqName: "empty",
          reqStatus: true,
        });
        this.formData["10461656-100012466"].isshow = true; //设备产商
        this.formData["10461656-100013577"].isshow = true; //设备型号
        this.formData["10461656-100012654"].isshow = true; //主控板软件版本
      } else {
        //设备产商 非必填
        this.SetRequired({
          attrName: "设备产商",
          formkey: "10461556-100012466",
          reqName: "empty",
          reqStatus: false,
        });
        this.formData["10461656-100012466"].isshow = false; //设备产商
        this.formData["10461656-100012466"].value = "";
        this.formData["10461656-100012654"].isshow = false; //主控板软件版本
        this.formData["10461656-100012654"].value = ""; //主控板软件版本 清空
        this.formData["10461656-100013577"].isshow = false; //设备型号
        this.formData["10461656-100013577"].value = ""; //设备型号 清空
      }
    },

    //乙端设备来源
    equiSourceB(val) {
      if (val == "30320001") {
        //设备产商 必填
        this.SetRequired({
          attrName: "设备产商",
          formkey: "10461657-100012466",
          reqName: "empty",
          reqStatus: true,
        });
        this.formData["10461657-100012466"].isshow = true; //设备产商
        this.formData["10461657-100013577"].isshow = true; //设备型号
        this.formData["10461657-100012654"].isshow = true; //主控板软件版本
      } else {
        //设备产商 非必填
        this.SetRequired({
          attrName: "设备产商",
          formkey: "10461657-100012466",
          reqName: "empty",
          reqStatus: false,
        });
        this.formData["10461657-100012466"].isshow = false; //设备产商
        this.formData["10461657-100012466"].value = "";
        this.formData["10461657-100012654"].isshow = false; //主控板软件版本
        this.formData["10461657-100012654"].value = ""; //主控板软件版本 清空
        this.formData["10461657-100013577"].isshow = false; //设备型号
        this.formData["10461657-100013577"].value = ""; //设备型号 清空
      }
    },

    feeShow(data) {
      let handleStateCd = JSON.parse(
        sessionStorage.getItem("changeRow")
      ).handleStateCd;
      //订单起一次费可改 需求单起送审核前一次费不可改
      if (handleStateCd == "50030002") {
        this.formData["10461653-100012373"].disabled = true; //出口局
        this.formData["10461653-100014235"].disabled = true; //提供路由图
        this.formData["10461653-100014075"].disabled = true; //是否双端业务标识
        this.formData["10461653-142000601"].disabled = true; //是否为低延时业务
        this.formData["10461653-142001015"].disabled = true; //时延期望值(ms)
        this.formData["10461653-142000604"].disabled = true; //时延类型
        this.formData["10461653-142000602"].disabled = true; //POP-to-POP时延(SLA承诺)
        this.formData["10461653-142000603"].disabled = true; //END-to-END时延(SLA承诺)
        this.formData["10461653-142000605"].disabled = true; //主备路由保护倒换的恢复方式
        this.formData["10461653-142001982"].disabled = true; //是否智能IEPL中继通道
        this.formData["10461653-100012301"].disabled = true; //是否客户能够自行协调境外点楼内线的实施
        this.formData["10461653-100000007"].disabled = true; //速率
        this.formData["10461656-100013021"].disabled = true; //甲装机地址
        this.formData["10461657-100013021"].disabled = true; //乙装机地址
        this.formData["10461653-100001004"].disabled = true; //业务类型
        this.formData["10461656-100013204"].disabled = true; //甲端端口类型
        this.formData["10461657-100013204"].disabled = true; //乙端端口类型
        this.formData["10461656-100012474"].disabled = true; //甲端设备来源
        this.formData["10461657-100012474"].disabled = true; //乙端设备来源
        this.formData["10461656-141000174"].disabled = true; //工作模式
        this.formData["10461657-141000174"].disabled = true; //工作模式
        this.formData["10461656-100000559"].disabled = true; //甲端接入类型
        this.formData["10461657-100000559"].disabled = true; //乙端接入类型
        this.formData["10461656-100012466"].disabled = true; //设备产商
        this.formData["10461657-100012466"].disabled = true; //设备产商
        this.formData["10461656-100013577"].disabled = true; //设备型号
        this.formData["10461657-100013577"].disabled = true; //设备型号
        this.formData["10461656-100012654"].disabled = true; //主控板软件版本
        this.formData["10461657-100012654"].disabled = true; //主控板软件版本
        this.formData["10461656-141000152"].disabled = true; //QINQ
        this.formData["10461657-141000152"].disabled = true; //QINQ
        this.formData["10461656-142002103"].disabled = true; //Licas网管配置方式
        this.formData["10461657-142002103"].disabled = true; //Licas网管配置方式
        this.formData["10461658-100012076"].disabled = true; //一次性费是否一口价
        this.formData["10461658-100011646"].disabled = true; //是否与首次月租一起支付
        this.formData["10461658-141000009"].disabled = true; //一次性费是否免费
        this.formData["10461658-100011007"].disabled = true; //一次性费用收费方式
        this.formData["10461659-100010651"].disabled = true; //一次性费用币种
        this.formData["10461659-100012523"].disabled = true; //调测费
        this.formData["10461659-100013081"].disabled = true; //一次性费用收款单位
        this.formData["10461659-100013366"].disabled = true; //一次性委托收款单位
        this.formData["10461660-100010651"].disabled = true; //一次性费用币种
        this.formData["10461660-100012523"].disabled = true; //调测费
        this.formData["10461660-100013081"].disabled = true; //一次性费用收款单位
        this.formData["10461660-100013366"].disabled = true; //一次性委托收款单位
      }
      //正常变更的地址变更不能修改月租费
      let serviceOfferId = JSON.parse(
        sessionStorage.getItem("changeRow")
      ).serviceOfferId;
      if (data.ORDER_DETAIL[0] && data.ORDER_DETAIL[0].CUSTOMER_ORDER[0]) {
        let custOrderType =
          data.ORDER_DETAIL[0].CUSTOMER_ORDER[0].custOrderType;
        if (custOrderType == "50200003" && serviceOfferId == "4041000000") {
          for (let i in this.formData) {
            if (
              this.formData[i].tableName == "ORD_OFFER_INST_FEE_INFO" ||
              this.formData[i].tableName == "ORD_PROD_INST_ACCT_REL" ||
              this.formData[i].tableName == "ORD_OFFER_INST_FEE_ATTR" ||
              this.formData[i].colId == "142001024" ||
              this.formData[i].colId == "100012516" ||
              this.formData[i].colId == "100012632"
            ) {
              //月租费，预收月数 SLA加收比率(%) 返点单位类型
              this.formData[i].disabled = true;
            }
          }
        }
      }
    },
  },
};
</script>
